<template>
  <div>
    <button @click="Show">显示|隐藏</button>

<!--    想谁有动画效果，就用transition包裹起来  appear 直接来就有动画-->
    <transition name="hello" :appear="true">
      <h1 v-show="isShow" >你好啊</h1>
    </transition>
  </div>
</template>

<script>
export default {
  // eslint-disable-next-line vue/multi-word-component-names
  name: "Test",
  data(){
    return{
      isShow:true,
    }
  },
  methods:{
    Show(){
      this.isShow = !this.isShow
    },

  }

}
</script>

<style scoped>
    h1{
      background-color: #de6b38;
    }
    /*!*进入的动画*!  hello-enter-active*/
    .hello-enter-active{
      /*linear匀速的*/
      animation: atguigu 1s;
    }
    /*离开的动画   reverse反转效果 hello-leave-active*/
    .hello-leave-active{
      animation: atguigu 1s reverse;
    }

    @keyframes atguigu {
      from{
        transform: translateX(-100%);
      }
      to{
        transform: translateX(0px);
      }
    }
</style>